import { createRouter, createWebHistory, Router, RouteRecordRaw } from 'vue-router'
import Login from '@/views/Login/Login.vue'
import Home from '@/views/Home/Home.vue'
import Error404 from '@/views/Error/404.vue'
import Error500 from '@/views/Error/500.vue'
import Error from '@/views/Error/Error.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/500',
    name: 'Error500',
    component: Error500
  },
  {
    path: '/404',
    name: '404',
    component: Error404
  },
  { path: '/:pathMatch(.*)*', redirect: '/404' }
]

const router: Router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
